{template '_header'}

<div class="page-header">当前位置：<span class="text-primary">创业者管理</span></div>

<div class="page-content">
<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
    <input type="hidden" name="c" value="site" />
    <input type="hidden" name="a" value="entry" />
    <input type="hidden" name="m" value="mx_shop" />
    <input type="hidden" name="do" value="web" />
    <input type="hidden" name="r" value="sgoods.owner" />

    <div class="page-toolbar">
        <div class="col-sm-4">
            <div class="pull-left">
                {ifp 'sgoods.owneradd'}
                <a class="btn btn-primary btn-sm" href="{php echo webUrl('sgoods/owneradd', array('id'=>$id))}"><i class="fa fa-plus"></i> 添加创业者</a>
                {/if}&nbsp;&nbsp;&nbsp;
                {ifp 'sgoods.main'}
                <a class="btn btn-default  btn-sm" href="{php echo webUrl('sgoods')}">返回设备列表</a>
                {/if}
            </div>
            <div class="input-group-btn">
                <button class="btn btn-default btn-sm"  type="button" data-toggle='refresh'><i class='fa fa-refresh'></i></button>
                {ifp 'sgoods.ownerdel'}
                <button class="btn btn-default btn-sm" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{php echo webUrl('sgoods/ownerdel')}"><i class='fa fa-trash'></i> 删除</button>
                {/if}
            </div>
        </div>
    </div>

</form>
{if count($list)>0}

<table class="table table-hover table-responsive">
    <thead class="navbar-inner" >
    <tr>
        <th style="width:25px;"><input type='checkbox' /></th>

        <th style='width:60px;'>id</th>
        <th style='width:80px;'>创业者名称</th>
        <th style='width:80px;'>头像</th>
        <th style='width:80px;'>占有比例</th>
        <th style='width:150px;'>操作</th>
    </tr>
    </thead>
    <tbody>
    {loop $list $row}
    <tr>

        <td>
            <input type='checkbox'   value="{$row['id']}"/>
        </td>

        <td >
            <span>{$row['id']}</span>
        </td>

        <td >
            <span>{$row['realname']}</span>
        </td>

        <td >
            <img src="{$row['avatar']}" style="width:70px;">
        </td>

        <td >
            <span>{$row['ratio']}%</span>
        </td>

        <td  style="overflow:visible;">
            {ifp 'sgoods.owneredit'}
            <div class="btn-group btn-group-sm">
                <a class="btn btn-default dropdown-toggle" href="{php echo webUrl('sgoods/owneradd', array('id'=>$id, 'ownerid'=>$row['id']))}"><i class="fa fa-edit"></i>编辑</a>
                {ifp 'sgoods.ownerdel'}
                <a data-toggle='ajaxRemove' href="{php echo webUrl('sgoods/ownerdel', array('id'=>$row['id']))}" class="btn btn-default btn-sm" data-confirm="确认要删除创业者吗?"><i class="fa fa-trash"></i> 删除</a>
                {/if}
            </div>
            {/if}
        </td>
    </tr>
    {/loop}
    </tbody>
</table>
{$pager}

{else}
<div class="panel panel-default">
    <div class="panel-body empty-data">未查询到相关数据</div>
</div>
{/if}
</div>
<script language="javascript">

    require(['bootstrap'],function(){
        $("[rel=pop]").popover({
            trigger:'manual',
            placement : 'left',
            title : $(this).data('title'),
            html: 'true',
            content : $(this).data('content'),
            animation: false
        }).on("mouseenter", function () {
            var _this = this;
            $(this).popover("show");
            $(this).siblings(".popover").on("mouseleave", function () {
                $(_this).popover('hide');
            });
        }).on("mouseleave", function () {
            var _this = this;
            setTimeout(function () {
                if (!$(".popover:hover").length) {
                    $(_this).popover("hide")
                }
            }, 100);
        });
    });

</script>

{template '_footer'}